﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO.Ports;
using System.Threading;
using System.Text.RegularExpressions;
using System.Configuration;

namespace Incendios0_1.sms
{
    /// <summary>
    /// Interaction logic for SMSWindow.xaml
    /// </summary>
    public partial class SMSWindow : Window
    {
        public SMSWindow()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //248115267

            SMS_Class SMS_sendMsg = new SMS_Class();

            string numero = phonumberTB.Text; //textBox1.Text;

            string mensaje = textBox2.Text;


            SMS_sendMsg.sendMsg(numero, mensaje);

            bool enviado = SMS_sendMsg.sendMsg(numero, mensaje);
            if (enviado == true)
            {
                MessageBox.Show("Mensaje Enviado Exitosamente");
            }
            else
            {
                MessageBox.Show("El Mensaje no se Envió");
            }

            Thread.Sleep(100);
            textBox2.Text = "";



        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {


            tabControl1.SelectedIndex = 1;






        }

        /*private void button3_Click(object sender, RoutedEventArgs e)
        {
            string number = textBox3.Text; //Número del contacto
            string name = textBox4.Text;   //Nombre del contacto

            comboBox1.Items.Add(number + "  " + name);
        }*/

        private void button4_Click(object sender, RoutedEventArgs e)
        {
            tabControl1.SelectedIndex = 0;
        }
    }
}
